package com.guaoran.micro.services.spring.boot.starter;

import com.guaoran.micro.services.spring.boot.starter.autoconfigurate.GuaoranProperties;
import com.guaoran.micro.services.spring.boot.starter.service.FormatProcessor;

/**
 * @Author gucheng
 * @Description 工具模板类
 * 2019-07-10 14:14
 */
public class GuaoranTemplate {
    private FormatProcessor formatProcessor;

    private GuaoranProperties guaoranProperties;
    public GuaoranTemplate(FormatProcessor formatProcessor,GuaoranProperties guaoranProperties) {
        this.formatProcessor = formatProcessor;
        this.guaoranProperties = guaoranProperties;
    }
    public String toString(Object object){
        StringBuffer buffer = new StringBuffer("template:<br/>");
        buffer.append("properties:"+guaoranProperties.getInfo()+"<br/>");
        buffer.append("format:"+formatProcessor.getString(object));
        return buffer.toString();
    }
}
